package com.kgc.ssm.service.impl;


import com.kgc.ssm.bean.Bill;
import com.kgc.ssm.mapper.BillMapper;
import com.kgc.ssm.service.BillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created On : 2022/8/16.
 * <p>
 * Author : zhukang
 * <p>
 * Description: BillServiceImpl
 */
@Service
public class BillServiceImpl implements BillService {

    @Autowired
    private BillMapper billMapper;


    @Override
    public int getBillCountByCondition(String queryProductName, String queryProviderId, Integer queryIsPayment) {
        return billMapper.selectBillCountByCondition(queryProductName, queryProviderId, queryIsPayment);
    }

    @Override
    public List<Bill> getBillListByCondition(String queryProductName, String queryProviderId, Integer queryIsPayment, Integer pageNo, Integer pageSize) {
        return billMapper.selectBillListByCondition(queryProductName, queryProviderId, queryIsPayment, pageNo, pageSize);
    }

    @Override
    public void delBillById(Integer billId) {
        billMapper.deleteBillById(billId);
    }

    @Override
    public Bill getBillById(Integer id) {
        return billMapper.selectBillById(id);
    }

    @Override
    public void modBillById(Bill billForm) {
        billMapper.updateBillById(billForm);
    }

    @Override
    public void addBillInfo(Bill billForm) {
        billMapper.insertBillInfo(billForm);
    }
}
